import Vuex from 'vuex'
import Vue from "vue";

Vue.use(Vuex)

const store = new Vuex.Store({
  state: {
    userData: {},
    departmentData: {},
    loginUserData:{},
    dailyData: {},
    overtimeData: {}
  },
  mutations: {
    setUserData(state, data) {
      state.userData = data
    },
    setDepartmentData(state, data) {
      state.departmentData = data
    },
    setLoginUserData(state, data) {
      state.loginUserData = data
    },
    setDailyData(state, data) {
      state.dailyData = data
    },
    setOvertime(state, data) {
      state.overtimeData = data
    },

  },
  getters: {
    getUserData(state) {
      console.log("获取")
      console.log(state.userData)
      return state.userData
    },
    getDepartmentData(state) {
      console.log("获取")
      console.log(state.departmentData)
      return state.departmentData
    },
    getLoginUserData(state) {
      console.log("获取")
      console.log(state.dailyData)
      return state.dailyData
    },
    getDailyData(state) {
      console.log("获取")
      console.log(state.loginUserData)
      return state.loginUserData
    },
    getOvertimeData(state) {
      console.log("获取")
      console.log(state.overtimeData)
      return state.overtimeData
    }
  },
  actions: {

  }
})

export default store;
